package com.video.videos.controller;


import com.video.common.enumeration.AppHttpCodeEnum;
import com.video.common.result.ResponseResult;
import com.video.videos.domain.dto.QueryPageDto;
import com.video.videos.domain.dto.QueryReplyDto;
import com.video.videos.domain.entity.Reply;
import com.video.videos.service.IReplyService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 回复表 前端控制器
 * </p>
 *
 * @author la
 * @since 2024-11-13
 */
@RestController
@RequestMapping("/reply")
@RequiredArgsConstructor
public class ReplyController {

    private final IReplyService service;


    /*
    * 根据id查询回复列表
    * */
    @GetMapping("/list")
    public ResponseResult list(QueryReplyDto dto) {
        return ResponseResult.okResult(service.QueryReplyList(dto));
    }

    /*
    * 新增回复
    * */
    @PostMapping("/increased")
    public ResponseResult increaseReply(@RequestBody Reply dto) {
        service.addReply(dto);
        return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
    }

}
